<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=, initial-scale=1.0">
    <title>Document</title>
    <style>
        .title {
            font-size: 50px;
        }
    </style>
</head>
<body>
    
<div id="app">
    <!-- <h2 v-bind:style="{属性名: 属性值}">{{massage}}</h2> -->

    <h2 v-bind:style="{fontSize: '50px'}">{{massage}}</h2>
    <h2 v-bind:style="{fontSize: firstSize}">{{massage}}</h2>
    <h2 v-bind:style="{fontSize: secondSize + 'px', backgroundColor: firstColor}">{{massage}}</h2>
    <h2 v-bind:style="getStyles()">{{massage}}</h2>
    <h2 style="color: rebeccapurple;">{{massage}}</h2>
</div>

<script src="../js/vue.js"></script>
<script>
    const app = new Vue({
        el: '#app',
        data: {
            massage: 'Hello Vue!',
            firstSize: '100px',
            secondSize: 150,
            firstColor: 'pink',
        },
        methods: {
            getStyles: function(){
                return {fontSize: this.secondSize + 'px', backgroundColor: this.firstColor}
            }
        },
    })
</script>
</body>
</html>